package cece.controller;

import cece.field.MovieField;
import cece.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SearchController {

    @Autowired
    private SearchService searchService;

    @RequestMapping(value = "/search/{keyWord}",method = RequestMethod.GET)
    public List<MovieField> keyWordSearch(@PathVariable String keyWord){
        List<MovieField> movieFields = searchService.keyWordSearch(keyWord);
        return movieFields;
    }
}
